# Archlive <http://archlive-pkg.googlecode.com>

pkgname=aufs2-util-git
pkgver=20090810
pkgrel=1
pkgdesc="aufs2 utils"
arch=("i686")
url="http://aufs.sourceforge.net"
license=('GPL')
depends=("bash")
conflicts=("aufs-utils")
_gitroot="http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-util.git"
_gitname="aufs2-util"
build() {

  cd "$srcdir"
  msg "Connecting to GIT server...."
  if [ -d $_gitname ] ; then
    cd $_gitname && git pull origin
    msg "The local files are updated."
  else
    git clone $_gitroot
  fi
  msg "GIT checkout done or server timeout"
  msg "Starting make..."
  rm -rf "$srcdir/$_gitname-build"
  cp -r "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname-build"
  #rm priv.mk
  KDIR=$"/usr/src/linux-`uname -r`" make || return 1
  mkdir -p "${pkgdir}"{/usr/bin,/sbin,/etc/default}
  make KDIR="/usr/src/linux-`uname -r`" DESTDIR="$pkgdir/" install
} 
